{% extends "forum/forumbase.html" %}

{% comment %}
#    Copyright 2012 New Mexico EPSCoR
#
#    This file is part of Teacher's P.E.T.
#
#    Teacher's P.E.T. is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    Teacher's P.E.T. is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with Teacher's P.E.T..  If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}

{% load files %}

{% block title %} Block List | {{block.super}}{% endblock title %}

{% block css %}
    {{block.super}}
    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/forum.css" >
{% endblock css %}

{% block content %}
<div class="forum-messages-index">
	<hr>
	<table class="forum-blocklist-table" border=0>
		<tr>
			<td></td>
			<td class="forum-blocklist-title"><h2>Block List</h2></td>
		</tr>
		<tr>
			<td class="forum-blocklist-index">
				<table class="forum-blocklist-index-table" border=0>
					<tr>
						<td>
							{% if request.user.unread_messages|length > 0 %}
								<a href="{% course_url forum_view_folder folder='inbox' %}"><b>Inbox&nbsp({{request.user.unread_messages|length}})</b></a>
							{% else %}
								<a href="{% course_url forum_view_folder folder='inbox' %}">Inbox</a>
							{% endif %}
						</td>
					</tr>
					<tr>
						<td>
							<a href="{% course_url forum_view_folder folder='drafts' %}">Drafts{% if user.draft_messages|length > 0 %}&nbsp({{user.draft_messages|length}}){% endif %}</a>
						</td>
					</tr>
					<tr><td><a href="{% course_url forum_view_folder folder='sent' %}">Sent</a></td></tr>
					<tr><td><a href="{% course_url forum_view_folder folder='trash' %}">Trash</a></td></tr>
					{% if request.user.block_list.all|length > 0 %}<tr><td><hr><a href="{% course_url forum_view_blocklist %}">Block&nbsp;List</a></td></tr>{% endif %}
				</table>
			</td>
			<td class="forum-blocklist-blocklist">
				<ul>
					{% for block in BlockList %}
						<li>
							{{block.blocked.first_name}}&nbsp;{{block.blocked.last_name}}
							<a href="{% course_url forum_unblock_message_sender message_id=block.message.id %}" class="forum-entries-button forum-blocklist-delete" title="Unblock this user">x</a>
						</li>
					{% endfor %}
				</ul>
			</td>
		</tr>
	</table>
</div>
{% endblock content %}